<?
session_start();
if(!session_is_registered("myusername")){
    header("location:index.php");
}
else{
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
        <title>Kartapuce - Projet BDD FPMs >> Aide</title>
        <link rel="stylesheet" href="./mystyle.css" type="text/css" media="screen" />
    </head>
    <body>
        <small>
            <b>Logged as:
                <?
                session_start();
                print $myusername;
                ?>
                <A HREF="./logout.php">Log out</A>

            </b>
        </small>

        <div id="conteneur" align="center" class="conteneur">
            <div align="center" class="conteneurdessus">
                <img src="img/banner.png" width="600" height="185" alt="banner" border="0"/>
            </div>
        </div>
        <center>
            <div id="conteneurdessus" align="center" class="conteneurdessus">
                <table border="0" cellspacing="10">
                    <td>
                        <A HREF="./boutique.php"><img src="img/boutique.png" width="138" height="39" alt="boutique" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./compte.php"><img src="img/compte.png" width="138" height="39" alt="compte" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./commandes.php"><img src="img/commandes.png" width="138" height="39" alt="commandes" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./panier.php"><img src="img/panier.png" width="138" height="39" alt="panier" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./accueil.php"><img src="img/accueil.png" width="138" height="39" alt="accueil" border="0"/>
                        </A>
                    </td>
                </table>

            </div>


            <font face="arial" size="5" color="black"><br><br>&nbsp<b>Modification des données</b></font>
            <div id='colonne1' align='left' class='colonnem'>
            <?
            include 'connect_db.php';



            $sql="SELECT db_clients.email, db_clients.nom, db_clients.telephone, db_clients.num, db_clients.rue, db_clients.ville_idville, db_ville.nom as 'ville', db_ville.cp as 'cp' FROM db_clients inner join db_ville on db_clients.ville_idville=db_ville.idville WHERE email='".$myusername."'";
            $result=mysql_query($sql);
            echo '<dd><font face="arial" size="3" color="black">Identifiant: <b>';
            print $myusername;
            echo '</b></dd></font><br>';

            echo '<form method="post" action="modif_user.php">';

            while($data = mysql_fetch_assoc($result))
                    {
                       echo '<blockquote><b>
                       <li type=circle><label>Nom: </label><input type="text" name="nom" size="30" value="'.$data['nom'].'" /><br /><br><b>
                       <li type=circle><label>Téléphone: </label><input type="text" name="telephone" size="30" value="'.$data['telephone'].'" /><br /><br><b>
                       <li type=circle>Adresse<br><br><dd><label>Rue: </label><input type="text" name="rue" size="30" value="'.$data['rue'].'" /><b>
                       <label>&nbsp&nbsp n°: </label><input type="text" name="num" size="5" value="'.$data['num'].'" /><br><b>
                       <label>CP : </label><input type="text" name="cp" size="4" value="'.$data['cp'].'" /><b>
                       <label>&nbsp&nbsp Ville: </label><input type="text" name="ville" size="25" value="'.$data['ville'].'" /><br /><br><b>
                        </dd></blockquote>';


                    }
            echo '<center><i>!! Saisie obligatoire de tous les champs</i></center>';
            echo '<dd><input type="submit" value="Envoyer" /></dd><br>';
      //    echo '<input type="reset" value="Recommencer" />';
            

            

            echo '</form>';







            mysql_close($link);

            ?>
            </div>





        </center>
    </body>
</html>